<div class=' bc-list' id='editor-brand-list' data-id='mall_id' data-port='http://api.hongyanche.com/mall_admin/product_getlist'>
<style>
#editor-brand-list-header.bc-scroll-float+*{margin-top:55px;}#editor-brand-list-header.bc-scroll-float{background: white;box-shadow: 0 0 5px #666;}
.pagination{display: inline-block;padding-left: 0;margin: 20px 0;border-radius: 4px;}
.pagination li {display: inline-block;}
.pagination li a {position: relative;float: left;padding: 6px 12px;margin-left: -1px;line-height: 1.42857143;color: #337ab7;text-decoration: none;background-color: #fff; border: 1px solid #ddd;}
.pagination li span {position: relative;float: left;padding: 6px 12px;margin-left: -1px;line-height: 1.42857143;color: #333;text-decoration: none;background-color: #fff; border: 1px solid #ddd;}
.pagination>li:first-child>a{margin-left: 0;border-top-left-radius: 4px;border-bottom-left-radius: 4px;}
.pagination>li:last-child>a{border-top-right-radius: 4px;  border-bottom-right-radius: 4px;}
</style>
	<div class="weui-panel__hd bc-scroll-move" id='editor-brand-list-header'>
		<div class='weui-flex-center'>
			<div class='weui-flex__item bc-list-menu'>
				<a class='bc-list-selectAll weui-btn weui-btn_mini weui-btn_default'>全选</a>
				<a></a>
				<a class='bc-list-selectReverse weui-btn weui-btn_mini weui-btn_default'>反选</a>
				<a></a>
				<a class='weui-btn weui-btn_mini weui-btn_warn' id='editor-brand-remove'>删除</a>
			</div>
			<div class='weui-flex__item'>
				<div class='weui-flex'>
					<div class='weui-flex__item'>
						<input autocomplete='off' name='keywords' class='weui-btn weui-btn_mini weui-btn_default' placeholder="关键字查找" />
					</div>
					&nbsp;&nbsp;
					<a class='weui-btn weui-btn_mini weui-btn_default'>搜索</a>
				</div>
			</div>
			&nbsp;&nbsp;
			<div class='weui-flex__item'>
				<a class='weui-btn weui-btn_mini weui-btn_primary' id='editor-brand-create'>添加新产品</a>
			</div>
			<a class='weui-cell_link bc-list-reload'>刷新<i class='i i-refresh'></i></a>&nbsp;&nbsp;&nbsp;
			<a class='weui-cell_link bc-list-edit'>编辑</a>&nbsp;&nbsp;&nbsp;
			<!--<a class='weui-cell_link' onclick='CONSOLE.editor.label.open()'>标签 ></a>-->
		</div>
			<div class='weui-flex-center' id="select-content" >
				<select name="" id="select-classification" class="js-select" style="margin-right: 5px">
					<option>请选择</option>
				</select>
				<select name="" id="select-classification-child" class="js-select">
				</select>
				<input autocomplete='off' id="select-label-id" name='labels' class='hidden' />
			</div>
	</div>

	<!-- {in1clude file='console:mall-editor-brand-label' /} -->
	<div class="weui-panel__bd">
		<input autocomplete='off' name='labels' class='hidden' id='editor-brand-list-labels-input' />
		<input class="hidden" name="page" id="mall-page" />
		<div class='bc-list-content'></div>
		<!-- bc-list-template -->
		<!-- bc-list-template -->
		<!-- bc-list-template -->
		<div class='bc-list-template'>
			<label href='javascript:CONSOLE.editor.brand.open(this)' class="weui-media-box weui-media-box_appmsg weui-cell_access">
				<div class="bc-list-checkbox">
					<input autocomplete='off' class='weui-check' type='checkbox'/>
					<i class="weui-icon weui-icon-checked-circle"></i>
				</div>
				<div class="weui-media-box__hd">
					<imgurl list=none><img class="weui-media-box__thumb" src="" alt=""></imgurl>
					<imgurl list=d><imgurl list=i><img style='height:60px' class="weui-media-box__thumb" /></imgurl></imgurl>
				</div>
				<div class="weui-media-box__bd">
					<h4 class="weui-media-box__title">
						<name list=1></name> <small style='color:teal'><detail_amount list=1></detail_amount>个价格</small>
					</h4>
					<p class="weui-media-box__desc"><description list=1></description></p>
					<ul class="weui-media-box__info">
						<li class="weui-media-box__info__meta"><labels_name list=1>[labels_name]</labels_name></li>
						<li class="weui-media-box__info__meta"><create_time list=t></create_time></li>
						<!-- <li class="weui-media-box__info__meta weui-media-box__info__meta_extra">其它信息</li> -->
					</ul>
				</div>
				<div class="weui-media-box__bd" style="flex:0.2">
					<released list=d><i class='i i-activityfill' style='color:#179B16'></i></released>
					<suggest list=d><i class='i i-crownfill' style='color:orange'></i></suggest>
				</div>
				<div class="weui-media-box__bd">
					<small style='color:maroon;' class='pull-right' >¥ <price_min list=f>0.00</price_min> ~ <price_max list=f>100.00</price_max> &nbsp;</small>
				</div>
				&nbsp;
				&nbsp;
				&nbsp;
				<div class="weui-cell__ft" style="margin-top: 8px;">
				</div>
				<div class="bc-list-checkbox">
					<i class='i i-menu' style='cursor: move;'></i>
				</div>
			</label>
		</div>
		<!-- bc-list-template -->
		<!-- bc-list-template -->
		<!-- bc-list-template -->
	</div>
</div>
<sss>
	function ajax_page(num) {
			$('#mall-page').val(num);
			LIST.reload('#editor-brand-list');
		};
	(function () {
	    var getData = function (uri) {
			return new Promise((resolve, reject) => {
			    $.ajax({
					url: uri,
					type: 'GET',
					success: function (data) {
						resolve(data)
                    },
					error: function (err) {
						reject(err)
                    }
				})
			})
        };
        var selectDom       = 	document.getElementById('select-classification');
		var selectDomChild  =   document.getElementById('select-classification-child');
		var selectContent   = 	document.getElementById('select-content');
		getData('http://api.hongyanche.com/mall_admin/labels').then((data) => {
			var datas = data.data.rank;
		    for (var i = 0; i<datas.length; i++) {
				var textNode	=	document.createTextNode(datas[i].category_cn);
				var opEle 	    = 	document.createElement('option');
				opEle.appendChild(textNode);
				$(opEle).val(datas[i].label_id);
				selectDom.appendChild(opEle);
				$(selectDomChild).hide();
                $(selectDom).on('change', function () {
                    $(selectDomChild).show();
                    var selectIndex		=	($(this).get(0).selectedIndex) -1;
					$(selectDomChild).empty();
					var text = document.createTextNode('请选择');
                    var ele = document.createElement('option');
                    ele.appendChild(text);
                    selectDomChild.appendChild(ele);
					for (var j = 0; j < datas[selectIndex].labels.length; j++) {
					    var textNodes 				= 	document.createTextNode(datas[selectIndex].labels[j].label_cn);
					    var opEle 					= 	document.createElement('option');
					    opEle.appendChild(textNodes);
					    $(opEle).val(datas[selectIndex].labels[j].label_id);
					    selectDomChild.appendChild(opEle);
					}
                })
			}
		}).catch((err) => {
		    throw new Error('出错了：'+ err)
		});

		$('.js-select').on('change', function () {
			let _id = $(this).val();
			$('#select-label-id').val(_id);
			$('#mall-page').val(' ');
            LIST.reload('#editor-brand-list');
		});
		
		$('#editor-brand-list').on('bc-list-success', function() {
			$('#editor-brand-list').find('.bc-list-loadmore').html(LIST.page)
		})
    })();
</sss>